package za.um.td.state;

import za.um.td.state.client.ClientStateNode;
import za.um.td.state.server.ServerStateNode;

import com.jmex.game.state.BasicGameStateNode;
import com.jmex.game.state.GameState;

public class MainStateNode extends BasicGameStateNode<GameState> {

	private static final String NAME = "MainStateNode";
	private static MainStateNode instance = null;

	private MainStateNode() {
		super(NAME);
		attachChildren();
		activateAllChildren();
	}
	
	private void attachChildren() {
		attachChild(ServerStateNode.getInstance());
		attachChild(ClientStateNode.createInstance());
	}

	public static MainStateNode getInstance() {
		if (instance == null) {
			instance = new MainStateNode();
		}
		return instance;
	}

}
